package club.hicode.daydayup.ssh;

import com.jcabi.ssh.Shell;
import com.jcabi.ssh.SshByPassword;
import org.junit.Test;

/**
 * 测试1
 *
 * @author Liu Chunfu
 * @date 2018-07-24 上午10:18
 **/
public class SSHTest1 {

    @Test
    public void test1() throws Exception {
        //此处也可以通过私钥的形式
        Shell ssh = new SshByPassword("alios", 22, "root", "j279PCdU$^Tm");
        String login = new Shell.Plain(new Shell.Safe(ssh)).exec("echo hello-iloveou");
        System.out.println(login);
    }

}
